//
//  HomeTongueShapeView.m
//  Ginix
//
//  Created by 冯志强 on 2025/2/23.
//

#import "HomeTongueShapeView.h"
#import "HomeTongueComView.h"

@interface HomeTongueShapeView()
@property (nonatomic,strong) HomeTongueComView * nameView;
@property (nonatomic,strong) YYLabel * nameLabel;
@property (nonatomic,strong) YYLabel * infoLabel;
@property (nonatomic,strong) YYLabel * drscLabel;
@end

@implementation HomeTongueShapeView

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        [self setSubViewLayout];
    }
    return self;
}

-(void)setSubViewLayout{
    
    [self addSubview:self.nameView];
    [_nameView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(@0);
        make.height.mas_offset(21 * FMScaleX);
    }];
    [self addSubview:self.nameLabel];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.nameView.mas_bottom).offset(15 * FMScaleX);
        make.size.mas_offset(CGSizeMake(300 * FMScaleX, 60 * FMScaleX));
        make.centerX.equalTo(@0);
    }];
    [self addSubview:self.infoLabel];
    [_infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.nameLabel.mas_bottom).offset(10 * FMScaleX);
        make.size.mas_offset(CGSizeMake(300 * FMScaleX, 150 * FMScaleX));
        make.centerX.equalTo(@0);
    }];
    [self addSubview:self.drscLabel];
    [_drscLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.infoLabel.mas_bottom).offset(10 * FMScaleX);
        make.size.mas_offset(CGSizeMake(300 * FMScaleX, 60 * FMScaleX));
        make.centerX.equalTo(@0);
    }];
}

-(HomeTongueComView *)nameView{
    
    if (!_nameView) {
        _nameView = [[HomeTongueComView alloc]init];
        _nameView.nameLabel.text = @"舌形状:";

    }
    return _nameView;
}
-(YYLabel *)nameLabel{
    
    if (!_nameLabel) {
        _nameLabel = [[YYLabel alloc]init];
        _nameLabel.font = Regular(13);
        _nameLabel.textColor = RDRGB(0x333333);
        _nameLabel.textContainerInset = UIEdgeInsetsMake(8 * FMScaleX, 8 * FMScaleX, 8 * FMScaleX, 8* FMScaleX);
        _nameLabel.text = @"齿痕舌：舌体边缘有牙齿压迫的痕迹，常与胖大舌同见。主脾虚和湿盛。";
        _nameLabel.numberOfLines = 0;
        _nameLabel.backgroundColor = RDRGB(0xF5F2ED);
    }
    return _nameLabel;
}

-(YYLabel *)infoLabel{
    
    if (!_infoLabel) {
        _infoLabel = [[YYLabel alloc]init];
        _infoLabel.font = Regular(13);
        _infoLabel.textColor = RDRGB(0x333333);
        _infoLabel.textContainerInset = UIEdgeInsetsMake(8 * FMScaleX, 8 * FMScaleX, 8 * FMScaleX, 8* FMScaleX);
        _infoLabel.text = @"舌尖点刺：点是指鼓起于舌面的红色、白色、或黑色星点;刺是指芒刺，即舌面上的软刺及颗粒增大，形成尖峰，高起如刺，摸之棘手;舌尖，映射心脏变化，该部位点刺的病理基础为心火旺盛，热邪上循舌面，蒸灼血脉，形成高于舌面的星点。";
        _infoLabel.numberOfLines = 0;
        _infoLabel.backgroundColor = RDRGB(0xF5F2ED);
    }
    return _infoLabel;
}

-(YYLabel *)drscLabel{
    
    if (!_drscLabel) {
        _drscLabel = [[YYLabel alloc]init];
        _drscLabel.font = Regular(13);
        _drscLabel.textColor = RDRGB(0x333333);
        _drscLabel.textContainerInset = UIEdgeInsetsMake(8 * FMScaleX, 8 * FMScaleX, 8 * FMScaleX, 8* FMScaleX);
        _drscLabel.text = @"瘦薄舌：舌体瘦小而薄。主气血不足、阴虚火旺。";
        _drscLabel.numberOfLines = 0;
        _drscLabel.backgroundColor = RDRGB(0xF5F2ED);
    }
    return _drscLabel;
}
@end
